package Lab12Package;

//Java 数组

public class Lab12_06 {
	public static void main(String[] args) {
		// while 循环
		System.out.print("\nwhile 循环\n");
		int i = 10;
		while (i < 20) {
			System.out.print("value of i : " + i);
			i++;
			System.out.print("\n");
		}
		// do…while 循环
		System.out.print("\ndo…while 循环\n");
		int x = 10;
		do {
			System.out.print("value of x : " + x);
			x++;
			System.out.print("\n");
		} while (x < 20);

		// for循环
		System.out.print("\nfor循环\n");
		for (int y = 10; y < 20; y = y + 1) {
			System.out.print("value of y : " + y);
			System.out.print("\n");
		}

		// for each 循环
		System.out.print("\nfor each 循环\n");
		double[] myList = {1.9, 2.9, 3.4, 3.5};

		// 打印所有数组元素
		for (double element : myList) {
			System.out.println(element);
		}
	}
}
